﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using AutoLoL.Logic.Repositories;
using AutoLoL.Entities;
using System.Collections.ObjectModel;

namespace AutoLoL.Logic.Factories
{
    // Is this a factory pattern? No idea =)
    public class ChampionFactory : IChampionRepository
    {
        private static ChampionFactory _instance;
        public static ChampionFactory Instance
        {
            get
            {
                if (_instance == null)
                {
                    _instance = new ChampionFactory();
                }

                return _instance;
            }
        }

        private IChampionRepository _repository;

        private ChampionFactory()
        {
        }

        public void SetRepository(IChampionRepository repository)
        {
            _repository = repository;
        }

        public Champion GetByName(string championName)
        {
            return _repository.GetByName(championName);
        }

        public ReadOnlyCollection<Champion> GetAll()
        {
            return _repository.GetAll();
        }

        public void SetSkins(Champion champion)
        {
            _repository.SetSkins(champion);
        }
    }
}
